package com.javashizhan.demo.mybatis.service;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.javashizhan.demo.mybatis.dao.UserDAO;
import com.javashizhan.demo.mybatis.domain.User;

@Service
public class UserService {

	@Autowired
	private UserDAO userDAO;

	public User findUserByName(@Param(value = "name") String name) throws Exception {
		return userDAO.findUserByName(name);
	}

	public void createUser(@Param(value = "user") User user) throws Exception {
		userDAO.createUser(user);
	}

	public int deleteUserByName(@Param(value = "name") String name) throws Exception {
		return userDAO.deleteUserByName(name);
	}
}
